/**
 * Copyright 2023 Inc.
 **/
package com.myz.service.loadbalancer.config;

import org.springframework.cloud.client.ServiceInstance;
import org.springframework.cloud.loadbalancer.core.ServiceInstanceListSupplier;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.context.annotation.Primary;
import reactor.core.publisher.Flux;

import java.util.List;

/**
 * @author maoyz0621 on 2023/3/28
 * @version v1.0
 */
@Configuration
public class ServiceInstanceConfiguration {

    @Bean
    @Primary
    public CustomerServiceInstanceListSupplier serviceInstanceListSupplier() {
        return new CustomerServiceInstanceListSupplier();
    }
}

class CustomerServiceInstanceListSupplier implements ServiceInstanceListSupplier {

    @Override
    public String getServiceId() {
        return null;
    }

    @Override
    public Flux<List<ServiceInstance>> get() {
        return null;
    }
}